package by.airlanterns.service;

import by.airlanterns.dao.ContentPageDaoImpl;
import by.airlanterns.dto.ContentPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by IntelliJ IDEA.
 * User: Sergey
 * Date: 01.02.13
 * Time: 18:50
 * To change this template use File | Settings | File Templates.
 */
@Service
public class ContentPageService {

    @Autowired
    private ContentPageDaoImpl contentPageDao;

    public void saveContent(ContentPage page) {
        contentPageDao.save(page);
    }

    public void saveOrUpdateContent(ContentPage page) {
        contentPageDao.saveOrUpdate(page);
    }

    public void updateContentPage(ContentPage page) {
        contentPageDao.saveOrUpdate(page);
    }

    public ContentPage getContentByPageId(int id) {
        return contentPageDao.findById(id);
    }

}
